Ruby program to create a block using curly braces {}

bookmark

arr = Array(1..5);   

puts "Array Elements: "
arr.each {|val| print val," ";}

 


Output:

Array Elements: 
1 2 3 4 5